from django.urls import path
from rest_framework.routers import SimpleRouter

from .views import LoginAPIView, RegisterView, FileUploadView, ImageUploadView, UserViewSet, CommentViewSet, \
    AvatarUploadView, SelfUploadViewSet, UploadViewSet, PraiseView, TestAPIView

urlpatterns = [
    path("login/", LoginAPIView.as_view()),
    path("register/", RegisterView.as_view()),
    path("upload/", FileUploadView.as_view()),
    path("uploadImage/", ImageUploadView.as_view()),
    path("uploadAvatar/", AvatarUploadView.as_view()),
    path("praise/", PraiseView.as_view()),
    path('', TestAPIView.as_view())
]

router = SimpleRouter()
router.register(r'user', UserViewSet, basename='user')
router.register(r'comment', CommentViewSet, basename='comment')
router.register(r'self', SelfUploadViewSet, basename='self')
router.register(r'get', UploadViewSet, basename='get')

urlpatterns += router.urls
